<?php
/**
  * Musashi - A project manager for music groups and bands
  * Copyright (C) 2010 Daniel Torres
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */

/**
 *  This view shows a data entry/edit form for venues
 *  
 *  @author Daniel Torres
 *  @package Musashi
 */

// Make sure we have access to this page
defined('_JEXEC') or die ('Restricted access. Sorry');
?>
<script language="javascript" type="text/javascript">
<!--
function submitbutton(pressbutton)
{
    var form = document.adminForm;
    
    // If we're just canceling, allow it to happen
    if(pressbutton=='cancel')
    {
        submitform(pressbutton);
        return;
    }
    
    // Make sure the name field is not empty
    if(form.name.value == "")
    {
        alert("You must supply a name for this venue");
        return;
    }
    
    submitform(pressbutton);    
}
//-->
</script>
<form action="index.php" method="post" name="adminForm" id="adminForm">
    <fieldset class="adminform" >
        <legend>Venue Details</legend>
        <table class="admintable">
            <tr>
                <td width="100" align="right" class="key">
                    Name:
                </td>
                <td>
                    <input class="text_area" type="text" name="name" id="name" size="50" maxlength="45"
                           value="<?php echo $this->record->name; ?>" />
                </td>
            </tr>
            <tr>
                <td width="100" align="right" class="key">
                    Address:
                </td>
                <td>
                    <input class="text_area" type="text" name="address" id="address" size="50" maxlength="45"
                           value="<?php echo $this->record->address; ?>" />
                </td>
            </tr>
            <tr>
                <td width="100" align="right" class="key">
                    Contact:
                </td>
                <td>
                    <input class="text_area" type="text" name="contact" id="contact" size="50" maxlength="255"
                           value="<?php echo $this->record->contact; ?>" />
                </td>
            </tr>
            <tr>
                <td width="100" align="right" class="key">
                    Link:
                </td>
                <td>
                    <input class="text_area" type="text" name="link" id="link" size="50" maxlength="45"
                           value="<?php echo $this->record->link; ?>" />
                </td>
            </tr>
            <tr>
                <td width="100" align="right" class="key">
                    Description:
                </td>
                <td>
                    <textarea class="text_area" type="text" name="description" id="description" cols="20" rows="4" 
                           style="width:500px"><?php echo $this->record->description; ?></textarea>
                </td>
            </tr>
            <tr>
                <td width="100" align="right" class="key">
                    Notes:
                </td>
                <td>
                    <textarea class="text_area" type="text" name="notes" id="notes" cols="20" rows="4" 
                           style="width:500px"><?php echo $this->record->notes; ?></textarea>
                </td>
            </tr>
        </table>
    </fieldset>
    
    
    <input type="hidden" name="option" value="com_musashi" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="controller" value="catalog" />
    <input type="hidden" name="id" value="<?php echo $this->record->id; ?>" />
    <input type="hidden" name="sectn" value="<?php echo $this->viewName; ?>" />
</form>
